<?
/*Default events contents*/
global $infopark;

if($_GET['day'])
{
   $dates[]= date('Ymd',strtotime(substr($_GET['day'],0,2)."-".substr($_GET['day'],2,2)."-".substr($_GET['day'],4)));
    // $dates[]= date('Ymd',strtotime(substr($_GET['date'],0,2)."-".substr($_GET['date'],2,2)."-".substr($_GET['date'],4)));
}else{

for($i=time();$i<strtotime("+7 days");($i+=24*60*60)){ $dates[]= date('Ymd',$i); }
}

$events=$infopark->get_events(0,null,$dates);
print $infopark->draw_events($events);
/*
Посмотри sites/all/modules/spec_events.module
function spec_events_ajaxed($req)

<section id="<?php print $block_html_id; ?>" >


	$categories_names = array(
		111 => 'Рекомендуем',
		79  => 'Лекции и встречи',
		61  => 'Театральные',
		62  => 'Концертные',
		63  => 'Клубные',
		71  => 'Фестивальыне',
		68  => 'Выставочные',
		74  => 'Цирк',
		70  => 'Шоу',
		64  => 'Кино',
		65  => 'Детские',
		67  => 'Профессиональные',
		66  => 'Спортивные',
	);

    $cities_list = array (
	    20 => 'Харьков',
	    21 => 'Киев',
	    41 => 'Одесса',
	    57 => 'Керчь'
    );
$cc =advert_compromise_get_citydomain($_SERVER['HTTP_HOST']);
	//$current_city_info = get_city_by_url();
	
	
	$current_city=$cc['tid'];
	#$current_city = $current_city_info['current_city'];
	$current_city_name=$cc['name'];
	#$current_city_name = $current_city_info['current_city_name'];

	?>
    <?php $month_names = array ('Января', 'Февраля', 'Марта', 'Апреля', 'Мая', '�?юня', '�?юля', 'Августа', 'Сентября', 'Октября', 'Ноября', 'Декабря');?>

    <div class="container">
	    <?php
	    
	    $days_currently_used = array(); ?>
        <?php foreach ($block->{'#events'} as $e) : 
		#pre($e);
		?>
        <?php if( ($current_city && $e->field_place_city_tid == $current_city ) || ($current_city == 0)): ?>

		    <?php $time = substr($e->field_schedule_start_value, 10, 6); ?>
			<?php $month = $month_names[(substr($e->field_schedule_start_value, 5, 2))-1]; ?>
			<?php $day_of_month = substr($e->field_schedule_start_value, 8, 2); ?>


			

            <div class="one_short_item <?php foreach ($e->categories as $category) :  echo "cat_".$category.' ';   endforeach;?> day_of_month_<?php echo $day_of_month; ?> the_date_<?=str_replace('-','_',substr($e->field_schedule_start_value,0,10));?>">
	            <?php if ($e->is_recommended == true) : ?>


                <div class="event_thumb_info">
                    <a href="<?php echo $e->alias; ?>">
			            <?php if (isset($e->uri)) : ?>
                        <div class="thumb"><img src="<?php echo image_style_url('100_100', $e->uri); ?>" /></div>
			            <?php else : ?>
                        <div class="thumb"></div>
			            <?php endif; ?>
                    </a>


                    <div class="info">
                    	<div class="event_time">
                    	    <?php echo $time;?>
                    	</div>
                    	<div class="infoleft">
	                        <h2><?php echo l($e->title, 'node/' . $e->nid); ?></h2>
				            <?php $flag = 0;?>
	                        <div class='event_places'>
					            <?php  foreach ($block->{'#places'}[$e->nid] as $p) :?>
					            <?php if ($flag>0) : ?>,&nbsp;<?php endif; ?>
		                        <?php if ($current_city == 0) {$prefix = $cities_list[$p->field_place_city_tid].' ';};?>
		                        <?php echo  l($prefix.$p->title, 'node/' . $p->field_schedule_place_nid); ?>
					            <?php $flag++;?>
					            <?php endforeach; ?>
	                        </div>
		                    <?php $counter = 0;?>
				            <?php foreach ($e->categories as $category) : if($counter > 0) echo ', '; echo $categories_names[$category];  $counter++; endforeach;?>
	                        
                        </div>
                        <div class="event_ticket">
		                    <?php if ($e->field_event_ticket_id_value) : ?>
                            <div class="ticket-link">


                                <script>
                                    jQuery(document).ready(function() {
                                        jQuery("#ticketstream_butt_<?php echo $e->field_event_ticket_id_value; ?>").click(function() {
                                            jQuery.fancybox.open([
                                                {
                                                    height: 550,
                                                    scrolling : 'auto',
                                                    title : 'Заказ билета',
                                                    type : 'iframe',
                                                    href: "http://www.ticketstream.cz/pls/ukraine/dls.dls_by_event_tr?event_id=<?php echo $e->field_event_ticket_id_value; ?>&code=INFOPARK&language=3",
                                                    wrapCSS: "ticketstream_css_class"
                                                }
                                            ]);
                                        });
                                    });
                                </script>
                                <a class="ticketstream_butt" id="ticketstream_butt_<?php echo $e->field_event_ticket_id_value; ?>" target="_blank">Заказать Билет</a>
                            </div>
		                    <?php endif; ?>
                        </div>
                </div>


				</div>

	            <?php else : ?>
                <table class="item_table">
                    <tr>
                        
                        <td class="event_thumb_info">
                            <a href="<?php echo $e->alias; ?>">
					       
                                <div class="thumb"><img src="<?php echo image_style_url('200_200', $e->uri); ?>" /></div>
					     
                            </a>

                            <div class="info">
                            	
                            	
                                <h2><?php echo l($e->title, 'node/' . $e->nid); ?></h2>
					            <?php $flag = 0;?>
					            
					            <div class="event_excerpt">Краткий текст описания на 2 строчки максимум, все что больше обрезается CSS</div>	
					            
                                <div class='event_places'>
						            <?php  foreach ($block->{'#places'}[$e->nid] as $p) :?>
						            <?php if ($flag>0) : ?>,&nbsp;<?php endif; ?>
	                                <?php $prefix = ''; ?>
	                                <?php if ($current_city == 0) {$prefix = $cities_list[$p->field_place_city_tid].' ';};?>
						            <?php echo  l($prefix.$p->title, 'node/' . $p->field_schedule_place_nid); ?>
						            <?php $flag++;?>
						            <?php endforeach; ?>
                                </div>
	                            
	                            
	                            <table class="short_info">
            						<tbody>
	            						<tr>
	            							<td>
	            								<div class="icon datetime"></div>
	            							</td>
	            							<td>
	            								<?php echo $time;?>
	            							</td>
	            						</tr>
	            						<tr>
	                                        <td class="short_info_label">
	                                            <div class="icon city"></div>
	                                        </td>
	                                        <td>
	                                            <a href="http://www.kharkiv.infopark.com.ua"> Харьков</a>
	                                        </td>
	            						</tr>
            						</tbody>
            					</table>
	                            
	                            
	                                                        
	                           
	                            
	                            
	                            <div class="event_ticket">
        				            <?php if ($e->field_event_ticket_id_value) : ?>
                                    <div class="ticket-link">
        
        
                                        <script>
                                            jQuery(document).ready(function() {
                                                jQuery("#ticketstream_butt_<?php echo $e->field_event_ticket_id_value; ?>").click(function() {
                                                    jQuery.fancybox.open([
                                                        {
                                                            height: 550,
                                                            scrolling : 'auto',
                                                            title : 'Заказ билета',
                                                            type : 'iframe',
                                                            href: "http://www.ticketstream.cz/pls/ukraine/dls.dls_by_event_tr?event_id=<?php echo $e->field_event_ticket_id_value; ?>&code=INFOPARK&language=3",
                                                            wrapCSS: "ticketstream_css_class"
                                                        }
                                                    ]);
                                                });
                                            });
                                        </script>
                                        <a class="ticketstream_butt" id="ticketstream_butt_<?php echo $e->field_event_ticket_id_value; ?>" target="_blank">Заказать</a>
                                    </div>
        				            <?php endif; ?>
                                </div>
	                            
                        </td>
                        
                    </tr>
                </table>
				<?php  endif;?>
                <?php if (user_access('bypass node access')) : ?>
                    <div class="admin-link">
                        <?php echo l('Редактировать', 'node/' . $e->nid . '/edit'); ?>
                    </div>
                <?php endif; ?>
            </div>
        <?php endif; ?>
        <?php endforeach; 

    </div>
</section>*/?>